package org.subatu.orm.test;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.jdbc.JdbcTest;
import org.springframework.jdbc.core.simple.JdbcClient;

import java.util.List;
import java.util.Map;

@JdbcTest
public class JdbcTester {

    @Autowired
    JdbcClient jdbcClient;

    @Test
    public void findAll() {
        String sql = "select * from mk_app";
        List<Map<String, Object>> list = jdbcClient.sql(sql).query().listOfRows();
        list.forEach(map -> {
            System.out.println("map = " + map);
        });

    }
}
